package com.ll.domain.tenant.base.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ll.base.exception.CustomRunTimeException;
import com.ll.dal.mapper.TenantMapper;
import com.ll.dal.po.TenantPO;
import com.ll.domain.tenant.base.TenantBaseService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class TenantBaseServiceImpl extends ServiceImpl<TenantMapper, TenantPO> implements TenantBaseService {

    private final TenantMapper tenantMapper;
    @Override
    public TenantPO getById(Long id, Boolean isCheckNull) {
        TenantPO tenantPO = tenantMapper.selectById(id);
        if(isCheckNull != null && isCheckNull){
            CustomRunTimeException.checkNull(tenantPO, "TenantPO");
        }
        return tenantPO;
    }
}
